package com.trkj.dao.wxy;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojo.QuestionType;

public interface QuestionTypeDao extends CrudRepository<QuestionType, String> {
	//多表查询分页
		@Query("select t,q from QuestionType t inner join t.questionBank q where t.questionType=?1 ")
		public List<Object[]> queryByQuestion(Pageable p,String questionType);
		

	//试题列表多表查询分页
	@Query("select t,q from QuestionType t inner join t.questionBank q")
	public List<Object[]> queryByQuestionType(Pageable p);
	
	//单选编辑
	@Query("select q from QuestionType q where q.testQuestions=?1")
	public QuestionType queryByQuestionTestQuestions(String testQuestions);
}
